
// javascript is very easy language

// Number // 64 bit double
// String
// Boolean
// Array
// Date
// Regexp


// null, undefined

// Object

// function


// variable

//data type

//variable is where you store some data and it is used inside the program

//Javascript is a loosely typed language

var count = 0; //typeof


count = "this is count";

// +
count = count + 1;

// count // 1
count += 1; // 2 this is a single line comment
console.log(count ++);  /** 3
   * this is a multi line
   */
++count; // 4

///
count = count + 1; //5
count += 20;//25
count + 30;//55 -- wrong //35

count = count + 1; //26


// decrement -

count = count - 1; // 25
count--; //24
count -= 10; // 14
--count; // 13

// *
//multiplication

// /
// division

count = count * 3;// multiplication 39
count= count / 3;// division  13


//
var name = "madhu"; //
var city = 'new york';

var bookTitle = "madhu's";
"madhu\"s";
'madhu\'s';

var sentence = 'madhu"s';

var firstName = 'Madhu';
var lastName = "Anugu";

var fullName = firstName +  lastName; // concatenation

//MadhuAnugu


var count = 10; // 10
//"102"
var total = count + "2"; //"102"

var finalTotal = total * 3;// 306

//auto type coercion -- type conversion
var sentence = "This is a sentence ";
sentence.length ;// characters

var upperSentence = sentence.toUpperCase();
sentence.toLowerCase();//

sentence.substr(0,3); //Thi

// Boolean

var isAnswered = true;
isAnswered = false;
//

//Array
// collection of items,
// collection of Numbers
//collection of strings
//collection of boolean
// collection of mix

var numbers = [0,1,2,3,4];

var mixedCollection = [false, 'sentence', 10, true, "word"];

//4

numbers.push(5); // adding new item to the end of array
// 0,1,2,3,4,5

var lastNumber = numbers.pop();//remove the last item from the array

//0,1,2,3,4

var firstNumber = numbers.shift();// removes the first item from the array

//0
//1,2,3,4

numbers.unshift(10); // it adds the number to top of the array
// 10,1,2,3,4
//10/2 -- 5
// 10 % 2 -- 0
// 9 % 2 -- 1

// 9 / 2 -- 4.5
//
// for
// if number is even or not
for(var i = 0;  i < numbers.length;i = i + 1){

    if(numbers[i]%2 == 0){
        console.log('Number ' + numbers[i] + ' is an even number' );
    }else{
        console.log('Number ' + numbers[i] + ' is a odd number' );
    }
}

var mixedCollection = [10,20,true,0, false, "false",32.6,"0",0,200,0];

for(var j = 0 ; j < mixedCollection.length; j++){
    if(mixedCollection[j] === 0){
        console.log('position at ' + j + ' and value ' + mixedCollection[j] + ' is zero' );
    }else{
        //console.log('position at ' + j + ' and value ' + mixedCollection[j] + ' is not zero' );
    }
}
// 3,8, 10

//3,4,7,8,10

//"0"
// big blunder

// ===
// ==

var isAnswered = true;
var isNotAnswred = false;
isAnswered = isAnswered + isAnswered + isNotAnswred; //2 , error , // value //
isAnswered = isNotAnswred * 5;// 0

//9 cst // 10

